﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using bdxyit.com.RecruitmentAppSys.ViewModels;

namespace bdxyit.com.RecruitmentAppSys.Controllers
{
    public class UserResumeController : Controller
    {
        // GET: /UserResume/

        public ActionResult Index(string id)
        {
            //var userResume = new UserResumeViewModels();
            //userResume.UserInfo = rdb.UserInfos.SingleOrDefault(a=> a.UserID==id);
            //userResume.familyInfo = rdb.FamilyInfos.Where(a=> a.UserID==id).ToList();
            //userResume.UserEducation=rdb.UserEducations.Where(a=> a.UserID==id).ToList();
            //userResume.userEducationFirst = rdb.UserEducations.SingleOrDefault(a=> a.UserID==id && a.Flag==1);
            //userResume.userEducationHighest = rdb.UserEducations.SingleOrDefault(a => a.UserID == id && a.Flag == 2);
            //userResume.abilityLevel =rdb.AbilityLevels.Where(a=> a.UserID==id).ToList();
            //userResume.abilityLevellanguage1 = rdb.AbilityLevels.SingleOrDefault(a => a.UserID == id && a.Flag == 1 && a.Type == "Languages");
            //userResume.abilityLevellanguage2 = rdb.AbilityLevels.SingleOrDefault(a => a.UserID == id && a.Flag == 2 && a.Type == "Languages");
            //userResume.abilityLevellanguage3 = rdb.AbilityLevels.SingleOrDefault(a => a.UserID == id && a.Flag == 3 && a.Type == "Languages");
            //userResume.abilityLevelComputer = rdb.AbilityLevels.SingleOrDefault(a => a.UserID == id && a.Flag == 1 && a.Type == "computer");
            //userResume.workListInfo = rdb.WorkListInfos.Where(a=> a.UserID==id).ToList();
            //userResume.professionalTechnicalInfo = rdb.ProfessionalTechnicalInfos.Where(a => a.UserID == id).ToList();
            //userResume.professionalTechnicalInfo1 = rdb.ProfessionalTechnicalInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 1);
            //userResume.professionalTechnicalInfo2 = rdb.ProfessionalTechnicalInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 2);
            //userResume.professionalTechnicalInfo3 = rdb.ProfessionalTechnicalInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 3);
            //userResume.professionalTechnicalInfo4 = rdb.ProfessionalTechnicalInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 4);
            //userResume.professionalTechnicalInfo5 = rdb.ProfessionalTechnicalInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 5);
            //userResume.skillLevelIdentificationInfo = rdb.SkillLevelIdentificationInfos.Where(a => a.UserID == id).ToList();
            //userResume.skillLevelIdentificationInfo1 = rdb.SkillLevelIdentificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 1);
            //userResume.skillLevelIdentificationInfo2 = rdb.SkillLevelIdentificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 2);
            //userResume.skillLevelIdentificationInfo3 = rdb.SkillLevelIdentificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 3);
            //userResume.skillLevelIdentificationInfo4 = rdb.SkillLevelIdentificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 4);
            //userResume.skillLevelIdentificationInfo5 = rdb.SkillLevelIdentificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 5);
            //userResume.occupationalQualificationInfo = rdb.OccupationalQualificationInfos.Where(a => a.UserID == id).ToList();
            //userResume.occupationalQualificationInfo1 = rdb.OccupationalQualificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 1);
            //userResume.occupationalQualificationInfo2 = rdb.OccupationalQualificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 2);
            //userResume.occupationalQualificationInfo3 = rdb.OccupationalQualificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 3);
            //userResume.occupationalQualificationInfo4 = rdb.OccupationalQualificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 4);
            //userResume.occupationalQualificationInfo5 = rdb.OccupationalQualificationInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 5);
            //userResume.otherEligibilityInfo = rdb.OtherEligibilityInfos.Where(a => a.UserID == id).ToList();
            //userResume.otherEligibilityInfo1 = rdb.OtherEligibilityInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 1);
            //userResume.otherEligibilityInfo2 = rdb.OtherEligibilityInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 2);
            //userResume.otherEligibilityInfo3 = rdb.OtherEligibilityInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 3);
            //userResume.otherEligibilityInfo4 = rdb.OtherEligibilityInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 4);
            //userResume.otherEligibilityInfo5 = rdb.OtherEligibilityInfos.SingleOrDefault(a => a.UserID == id && a.Flag == 5);
            //userResume.applyJobAction = rdb.ApplyJobActions.Where(a => a.UserID == id).ToList();
            //userResume.applyJobActionFirst = rdb.ApplyJobActions.SingleOrDefault(a=> a.UserID==id && a.Flag==1);
            //userResume.applyJobActionSecond = rdb.ApplyJobActions.SingleOrDefault(a => a.UserID == id && a.Flag == 2);
            //userResume.applyJobActionThird = rdb.ApplyJobActions.SingleOrDefault(a => a.UserID == id && a.Flag == 3);

            //userResume.SysSex = rdb.SystemInfos.Where(a => a.Type == "sex").ToList();
            //userResume.EthnicList = rdb.EthnicLists.ToList();
            //userResume.SysPolitical = rdb.SystemInfos.Where(a => a.Type == "PolAffiliation").ToList();
            //userResume.SysVision = rdb.SystemInfos.Where(a => a.Type == "Eyesight").ToList();
            //userResume.SysMarital = rdb.SystemInfos.Where(a => a.Type == "MaritalStatus").ToList();
            //userResume.SysFamRelationship = rdb.SystemInfos.Where(a => a.Type == "FamRelationship").ToList();
            //userResume.SysEdu = rdb.SystemInfos.Where(a => a.Type == "EducationType").ToList();
            //userResume.AreaList = rdb.AreaLists.ToList();
            //userResume.UniversityList = rdb.UniversityLists.ToList();
            //userResume.ProfessionalTypeList = rdb.ProfessionalTypeLists.ToList();
            //userResume.ProfessionalList = rdb.ProfessionalLists.ToList();
            //userResume.DegreeList = rdb.DegreeLists.ToList();
            //userResume.EducationList = rdb.EducationLists.ToList();
            //userResume.SysLanguage = rdb.SystemInfos.Where(a => a.Type == "Languages").ToList();
            //userResume.LanguageLevel = rdb.LanguageLevels.ToList();
            //userResume.SysComputer = rdb.SystemInfos.Where(a => a.Type == "computer").ToList();
            //userResume.ComputerLevel = rdb.ComputerLevels.ToList();
            //userResume.SysProfessional = rdb.SystemInfos.Where(a => a.Type == "ProAndTechSeries").ToList();
            //userResume.ProfessionalName = rdb.SkillLists.ToList();
            //userResume.SysProfessionalLevel = rdb.SystemInfos.Where(a => a.Type == "ProAndTechLevel").ToList();
            //userResume.SkillTitlesType = rdb.TitlesLists.ToList();
            //userResume.SysLevel = rdb.SystemInfos.Where(a => a.Type == "IdentificationLevel").ToList();
            //userResume.SysOccType = rdb.SystemInfos.Where(a => a.Type == "VocationalType").ToList();
            //userResume.SysOther = rdb.SystemInfos.Where(a => a.Type == "OtherType").ToList();
            //userResume.CompanyInfo = rdb.CompanyInfos.ToList();
            //userResume.CompanyPost = rdb.CompanyPosts.ToList();
            
            //return View(userResume);
            return View();
        }

        //
        // GET: /UserResume/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /UserResume/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /UserResume/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /UserResume/Edit/5
 
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /UserResume/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /UserResume/Delete/5
 
        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /UserResume/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
